<div class="Item hr">
    <div class="current">{$name}内容列表</div>
    <div class="fr"><a href="{:U('index')}" class="btn">返回自定义表单列表</a></div>
</div>
<form>
<volist name='list' id='fields'>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
    <tbody>
      <tr style="background:#FFFFCC">
        <th width="20%">{:genCheckbox('id', '', $fields['id'], false, 'id')}id</th>
        <td>{$fields.id}&nbsp;&nbsp;&nbsp; 状态: {$fields['ifcheck'] == 0 ? '未审核' : '已审核'}
          </td>
      </tr>
      <volist name='fieldlist' id='field'>
        <if condition="$fields[$key] neq ''">
          <tr>
            <th>{$field.comment}</th>
            <td>{$fields[$field['name']]}</td>
          </tr>
        </if>
      </volist>
      <tr>
      	<th>提交时间</th>
        <td>{$fields.dubtime|timeToStr}</td>
      </tr>
      </tbody>
  </table>
</volist>
<input type="hidden" id="diyid" value="{$diyid}" />
</form>
<div class="page">
    {$page}
</div>
<div class="commonBtnArea" >
<label><input name="" class="chooseAll" type="checkbox"> 全选</label> <label><input name="" class="unsetAll" type="checkbox"> 反选</label>
    <button class="btn DoDiyData" data-type="delete" data-url="{:U('DoDiyData')}">删除</button>
    <button class="btn DoDiyData" data-type="check" data-url="{:U('DoDiyData')}">审核</button>
</div>
<script type="text/javascript">
	clickCheckbox();
    $(".DoDiyData").click(function(){
        var url = $(this).data("url");
		var isSubmit = false;
		var act = $(this).data("type");
		var diyid = $("#diyid").val();
		var ids = [];
		$(".id").each(function(){
			if($(this).prop("checked")){
				isSubmit = true;
				ids.push($(this).val());
			}
		})
		if(isSubmit){
			popup.confirm("您确定批量操作数据？", '温馨提示',function(action){
				if(action == 'ok'){
					$.ajax({
						"url" : url,
						"dataType" : "JSON",
						"type" : "POST",
						"data" : {"ids" : ids, "act" : act, 'diyid' : diyid},
						"success" : function(json){
						if (json.status) {
							popup.success(json.info, "操作成功", function(){
								if(json.url){
									window.location.href = json.url;
								}else{
									top.window.location.reload();
								}
							});
						} else {
							popup.error(json.info);
							setTimeout(function(){
								popup.close("asyncbox_error");
							},2000);
						}
					}
					});
				}
			});
		}
        return false;
    });
</script>